package cc.mrbird.assets.service.impl;

import cc.mrbird.assets.domain.AssetUnit;
import cc.mrbird.assets.service.AssetUnitService;
import cc.mrbird.common.service.impl.BaseService;
import cc.mrbird.unit.domain.UserUnit;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Arrays;
import java.util.List;

@Service("assetUnitService")
public class AssetUnitServiceImpl  extends BaseService<AssetUnit> implements AssetUnitService {



    @Override
    @Transactional
    public void deleteAssetUnitByAssetId(String assetId) {
        List<String> list = Arrays.asList(assetId.split(","));
        this.batchDelete(list, "asset_id", AssetUnit.class);
    }

    @Override
    @Transactional
    public void deleteAssetUnitByUnitId(String unitId) {
        List<String> list = Arrays.asList(unitId.split(","));
        this.batchDelete(list, "unit_id", AssetUnit.class);
    }
}
